#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main (int argc, char const* argv[])
{
    char buf[128], ans[128], ch;
    int offset, len, i, j, error_flg;

    offset = 'a' - 'A';

    scanf("%s", buf);
    len = strlen(buf);
    error_flg = 1;
    for (i = 0, j = 0; i < len; i++, j++) {
        ch = buf[i];
        // first character is upper case.
        if (i == 0 && (ch < 'a' || ch > 'z')) {
            break; 
        }

        if (ch >= 'A' && ch <= 'Z') {
            ans[j] = '_';
            ans[++j] = ch + offset;
            error_flg = 0;
        } else if (ch == '_') {
            if (i+1 >= len || buf[i+1] > 'z' || buf[i+1] < 'a') {
                error_flg = 1;
                break;
            } else {
                ch = buf[++i];
                ans[j] = ch - offset;
                error_flg = 0;
            }
        } else if (ch >= 'a' && ch <= 'z') {
            ans[j] = ch;
            error_flg = 0;
        } else {
            error_flg = 1;
            break;
        }
    }

    if (error_flg) {
        printf("Error!");
    } else {
        ans[j] = '\0';
        printf("%s", ans);
    }

    printf("\n");

    return 0;
}
